﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>


<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <link href="<%= ResolveUrl("~/Content/Styles/fullcalendar.css") %>" rel="stylesheet" type="text/css" />
    <link href="<%= ResolveUrl("~/Content/Styles/fullcalendar.print.css") %>" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript" src="<%= ResolveUrl("~/Content/Scripts/fullcalendar.min.js") %>"></script>

</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="box">
        <div class="title">
            <h5>Lịch</h5>
        </div>
        <div style="padding-left: auto; padding-right: auto;">
            <div id="calendarTest" style="margin: auto;width: 95%; "></div>
        </div>
    </div>

    <script type="text/javascript">
        //$(document).ready(function () {//initialize the calendar
        $('#calendarTest').fullCalendar({
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,agendaDay'
            },
            editable: true,
            droppable: true, // this allows things to be dropped onto the calendar !!!
            drop: function (date, allDay) { // this function is called when something is dropped
                // retrieve the dropped element's stored Event Object
                var originalEventObject = $(this).data('eventObject');
                // we need to copy it, so that multiple events don't have a reference to the same object
                var copiedEventObject = $.extend({}, originalEventObject);
                // assign it the date that was reported
                copiedEventObject.start = date;
                copiedEventObject.allDay = allDay;
                // render the event on the calendar
                // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
                $('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
                // is the "remove after drop" checkbox checked?
                if ($('#drop-remove').is(':checked')) {
                    // if so, remove the element from the "Draggable Events" list
                    $(this).remove();
                }
            }
        }); 
        //});
    </script>
</asp:Content>

